<dt><code>Off</code></dt><dd>A request will only be accepted if it
maps to a literal path that exists. Therefore a request with
trailing pathname information after the true filename such as
<code>/test/here.html/more</code> in the above example will return
a 404 NOT FOUND error.</dd>
<dt><code>On</code></dt><dd>A request will be accepted if a
leading path component maps to a file that exists. The above
example <code>/test/here.html/more</code> will be accepted if
<code>/test/here.html</code> maps to a valid file.</dd>
<dt><code>Default</code></dt><dd>The treatment of requests with
trailing pathname information is determined by the <a href="../handler.html">handler</a> responsible for the request.
The core handler for normal files defaults to rejecting
<code>PATH_INFO</code> requests. Handlers that serve scripts, such as <a href="mod_cgi.html">cgi-script</a> and <a href="mod_isapi.html">isapi-isa</a>, generally accept
<code>PATH_INFO</code> by default.</dd>
</dl>
<p>The primary purpose of the <code>AcceptPathInfo</code>
directive is to allow you to override the handler's choice of
accepting or rejecting <code>PATH_INFO</code>. This override is required,
for example, when you use a <a href="../filter.html">filter</a>, such
as <a href="mod_include.html">INCLUDES</a>, to generate content
based on <code>PATH_INFO</code>. The core handler would usually reject
the request, so you can use the following configuration to enable
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.33 and later; deprecated in Apache 2.1 and later</td></tr>
</table>
<p>This directive activates a particular output <a href="../filter.html">filter</a> for a request depending on the
response <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME-type</a>. Because of certain
problems discussed below, this directive is deprecated. The same
functionality is available using <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code>.</p>
<p>The following example uses the <code>DEFLATE</code> filter, which
is provided by <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>. It will compress all
output (either static or dynamic) which is labeled as
<code>text/html</code> or <code>text/plain</code> before it is sent
<p>Enabling filters with <code class="directive">AddOutputFilterByType</code>
may fail partially or completely in some cases. For example, no
filters are applied if the <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME-type</a> could not be determined and falls
back to the <code class="directive"><a href="#defaulttype">DefaultType</a></code> setting,
even if the <code class="directive"><a href="#defaulttype">DefaultType</a></code> is the
same.</p>
<p>However, if you want to make sure, that the filters will be
applied, assign the content type to a resource explicitly, for
example with <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> or
<code class="directive"><a href="#forcetype">ForceType</a></code>. Setting the
content type within a (non-nph) CGI script is also safe.</p>
<p>The by-type output filters are never applied on proxy requests.</p>
sections specified without regular expressions, not in <code class="directive"><a href="#location"><Location></a></code>, <code class="directive"><a href="#directorymatch"><DirectoryMatch></a></code> or
Allow use of the directives controlling host access (<code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code>, <code class="directive"><a href="../mod/mod_authz_host.html#deny">Deny</a></code> and <code class="directive"><a href="../mod/mod_authz_host.html#order">Order</a></code>).</dd>
<dt>Options[=<var>Option</var>,...]</dt>
<dd>
Allow use of the directives controlling specific directory
features (<code class="directive"><a href="#options">Options</a></code> and
<p>This directive sets the name of the authorization realm for a
directory. This realm is given to the client so that the user
knows which username and password to send.
<code class="directive">AuthName</code> takes a single argument; if the
realm name contains spaces, it must be enclosed in quotation
marks. It must be accompanied by <code class="directive"><a href="#authtype">AuthType</a></code> and <code class="directive"><a href="#require">Require</a></code> directives, and directives such
as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
<code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
work.</p>
<p>For example:</p>
<div class="example"><p><code>
AuthName "Top Secret"
</code></p></div>
<p>The string provided for the <code>AuthName</code> is what will
appear in the password dialog provided by most browsers.</p>
<h3>See also</h3>
<ul>
<li><a href="../howto/auth.html">Authentication, Authorization, and
<p>This directive selects the type of user authentication for a
directory. The authentication types available are
<code>Basic</code> (implemented by
<code class="module"><a href="../mod/mod_auth_basic.html">mod_auth_basic</a></code>) and <code>Digest</code>
(implemented by <code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code>).</p>
<p>To implement authentication, you must also use the <code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#require">Require</a></code> directives. In addition, the
server must have an authentication-provider module such as
<code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code> and an authorization module such
as <code class="module"><a href="../mod/mod_authz_user.html">mod_authz_user</a></code>.</p>
<p>There will be times when the server is asked to provide a
document whose type cannot be determined by its <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME types</a> mappings.</p>
<p>The server must inform the client of the content-type of the
document, so in the event of an unknown type it uses the
<code>DefaultType</code>. For example:</p>
<div class="example"><p><code>
DefaultType image/gif
</code></p></div>
<p>would be appropriate for a directory which contained many GIF
images with filenames missing the <code>.gif</code> extension.</p>
<p>Note that unlike <code class="directive"><a href="#forcetype">ForceType</a></code>, this directive only
provides the default mime-type. All other mime-type definitions,
including filename extensions, that might identify the media type
cannot nest, and cannot appear in a <code class="directive"><a href="#limit"><Limit></a></code> or <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section.</p>
<h3>See also</h3>
<ul>
<li><a href="../sections.html">How <Directory>,
<Location> and <Files> sections work</a> for an
explanation of how these different sections are combined when a
<p>This directive sets the directory from which <code class="program"><a href="../programs/httpd.html">httpd</a></code>
will serve files. Unless matched by a directive like <code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code>, the server appends the
path from the requested URL to the document root to make the
path to the document. Example:</p>
<div class="example"><p><code>
DocumentRoot /usr/web
</code></p></div>
<p>then an access to
<code>http://www.my.host.com/index.html</code> refers to
<code>/usr/web/index.html</code>. If the <var>directory-path</var> is
not absolute then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
<p>The <code class="directive">DocumentRoot</code> should be specified without
a trailing slash.</p>
<h3>See also</h3>
<ul>
<li><a href="../urlmapping.html">Mapping URLs to Filesystem
<p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred,
however.</p>
<p>Note that unlike <code class="directive"><a href="#directory"><Directory></a></code> and <code class="directive"><a href="#location"><Location></a></code> sections, <code class="directive"><Files></code> sections can be used inside
<code>.htaccess</code> files. This allows users to control access to
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.47 and later</td></tr>
</table>
<p>An internal redirect happens, for example, when using the <code class="directive"><a href="../mod/mod_actions.html#action">Action</a></code> directive, which internally
redirects the original request to a CGI script. A subrequest is Apache's
mechanism to find out what would happen for some URI if it were requested.
For example, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
files listed in the <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
directive.</p>
<p><code class="directive">LimitInternalRecursion</code> prevents the server
from crashing when entering an infinite loop of internal redirects or
subrequests. Such loops are usually caused by misconfigurations.</p>
<p>The directive stores two different limits, which are evaluated on
per-request basis. The first <var>number</var> is the maximum number of
internal redirects, that may follow each other. The second <var>number</var>
determines, how deep subrequests may be nested. If you specify only one
<var>number</var>, it will be assigned to both limits.</p>
completely outside the filesystem. This has several consequences.
Most importantly, <code class="directive"><Location></code>
directives should not be used to control access to filesystem
locations. Since several different URLs may map to the same
filesystem location, such access controls may by circumvented.</p>
<div class="note"><h3>When to use <code class="directive"><Location></code></h3>
<p>Use <code class="directive"><Location></code> to apply
directives to content that lives outside the filesystem. For
content that lives in the filesystem, use <code class="directive"><a href="#directory"><Directory></a></code> and <code class="directive"><a href="#files"><Files></a></code>. An exception is
<code><Location /></code>, which is an easy way to
apply a configuration to the entire server.</p>
</div>
<p>For all origin (non-proxy) requests, the URL to be matched is a
URL-path of the form <code>/path/</code>. No scheme, hostname,
port, or query string may be included. For proxy requests, the
URL to be matched is of the form
<code>scheme://servername/path</code>, and you must include the
prefix.</p>
<p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
any single character, and <code>*</code> matches any sequences of
<p><code class="directive">Require</code> must be accompanied by
<code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#authtype">AuthType</a></code> directives, and directives such
as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>
and <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> (to
define users and groups) in order to work correctly. Example:</p>
<div class="example"><p><code>
AuthType Basic<br />
AuthName "Restricted Resource"<br />
AuthUserFile /web/users<br />
AuthGroupFile /web/groups<br />
Require group admin
</code></p></div>
<p>Access controls which are applied in this way are effective for
<strong>all</strong> methods. <strong>This is what is normally
desired.</strong> If you wish to apply access controls only to
specific methods, while leaving other methods unprotected, then
place the <code class="directive">Require</code> statement into a
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Influenced by <code class="directive"><a href="#limit"><Limit></a></code> and <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> in version 2.0.51 and
later</td></tr>
</table>
<p>Access policy if both <code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code> and <code class="directive"><a href="#require">Require</a></code> used. The parameter can be
either <code>All</code> or <code>Any</code>. This directive is only
useful if access to a particular area is being restricted by both
username/password <em>and</em> client host address. In this case
the default behavior (<code>All</code>) is to require that the client
passes the address access restriction <em>and</em> enters a valid
username and password. With the <code>Any</code> option the client will be
granted access if they either pass the host restriction or enter a
valid username and password. This can be used to password restrict
an area, but to let clients from particular addresses in without
prompting for a password.</p>
<p>For example, if you wanted to let people on your network have
unrestricted access to a portion of your website, but require that
people outside of your network provide a password, you could use a
configuration similar to the following:</p>
<div class="example"><p><code>
Require valid-user<br />
Allow from 192.168.1<br />
Satisfy Any
</code></p></div>
<p>Since version 2.0.51 <code class="directive">Satisfy</code> directives can
be restricted to particular methods by <code class="directive"><a href="#limit"><Limit></a></code> and <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> sections.</p>
<p>The <code class="directive">ServerRoot</code> directive sets the
directory in which the server lives. Typically it will contain the
subdirectories <code>conf/</code> and <code>logs/</code>. Relative
paths in other configuration directives (such as <code class="directive"><a href="#include">Include</a></code> or <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>, for example) are taken as
and <Files> sections work</a> for an explanation of how these
different sections are combined when a request is received</li>
</ul>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
<a href="../en/mod/core.html" title="English"> en </a> |
<a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
</div><div id="footer">
<p class="apache">Copyright 1995-2006 The Apache Software Foundation or its licensors, as applicable.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>